import wx


class MyFrame(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, title=title, size=(300, 200))
        self.panel = wx.Panel(self)
        self.colorbutton = wx.Button(self.panel, label="Choose Color", pos=(50, 50))
        self.filebutton = wx.Button(self.panel, label="Choose File", pos=(150, 50))
        self.colorbutton.Bind(wx.EVT_BUTTON, self.OnColor)
        self.filebutton.Bind(wx.EVT_BUTTON, self.OnFile)

    def OnColor(self, event):
        dlg = wx.ColourDialog(self.panel)
        if dlg.ShowModal() == wx.ID_OK:
            color = dlg.GetColourData().GetColour().Get()
            print("You selected color:", color)
        dlg.Destroy()

    def OnFile(self, event):
        dlg = wx.FileDialog(self.panel, "Choose a file", wildcard="*.txt")
        if dlg.ShowModal() == wx.ID_OK:
            path = dlg.GetPath()
            print("You selected file:", path)
        dlg.Destroy()


app = wx.App(False)
frame = MyFrame(None, 'Dialogs and Tools Example')
frame.Show(True)
app.MainLoop()